<?php

/**
 * Controller_performance
 * 成绩
 */

class Controller_performance extends MyApp {

	public function __construct()
	{
		parent::__construct();

		$this->model->log        = YOU::loadModel('log');

	}
    /** 首页 **/
    public function actionIndex()
    {

    }
   
	/** 成绩录入 **/
    public function actionPerformanceInAdd()
    {    
		// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
		// 年级
		$grade_list = $this->db->fetchAll("SELECT `grade_name`,`grade_id` FROM `tbl_grade`");
		// 班级
		$class_list = $this->db->fetchAll("SELECT `class_name`,`class_name` FROM `tbl_class`");
		// 科目
		$subject_list = $this->db->fetchAll("SELECT `subject_name`,`subject_id` FROM `tbl_subject`");

        if ($_POST){ 

            $grade_id     	    = $this->post->grade_id;
            $class_id   		= $this->post->class_id;
			$subjcet_di   		= $this->post->subjcet_di;

            // 写入数据库
            $info = array( 
				
			"manage_title"  	    => $manage_title,
            "manage_content"       	=> $manage_content,
			// 教学工作手册 =5
			"manage_type"       	=> 5,	
            "status"                => 1,
            "create_time"           => date("Y-m-d H:i:s"),
            "update_time"           => "0000-00-00 00:00:00",  

			 );

          $this->db->do_insert("tbl_manage", $info);
          $this->tpl->display("performance/add.tpl.php");

         }
         $this->tpl->assign("grade_list", $grade_list); 
		 $this->tpl->assign("class_list", $class_list);
		 $this->tpl->assign("subject_list", $subject_list);
         $this->tpl->display("performance/in.add.tpl.php");
    }
    
	

}

?>